home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: load average patches for MiNT 1.10 + patches
- Date: Fri, 11 Mar 94 18:49:28 CET
- From: Juergen Lock <nox@jelal.north.de>
- In-Reply-To: <2d7f745a1e7e81@anuurn.do.open.de>; from "Martin Koehling" at Mar 10, 94 8:25 pm
- Message-Id: <9403111749.AA00136@jelal.north.de>
-
- Martin Koehling writes:
- > Hi Juergen,
- moin
- >
- > >michael smith writes:
- > >> but I don't believe in that sort
- > >> of ceiling regardless of how it's implemented, and someone is _bound_ to harp
- > >> on it.)
- > >
- > > true. thats also why you should always do timeouts checks like this
- > >
- > > unsigned tick = timer counter (like _hz_200) + time to wait;
- > > for (...)
- > > if (timer counter - tick > 0) break;
- > >
- > >instead of
- > > ...
- > > if (timer counter > tick) break;
- > >
- > >(and any compiler that `optimizes' the difference away should be shot. :)
- >
- > I don't quite see the difference between these two checks - they _both_
- > will come into trouble if `counter + time to wait' exceeds the value range
- > of `unsigned'!
-
- hmpf i shouldn't post from memory... remove the unsigned, i.e. make
- it a signed comparison. better? :)
-
- > The only *real* solution I can see is expanding the timer to a `long
- > long'...
-
- only if the timeout is longer than 2^31 ticks.
- >
- > Martin
- cheers
- Juergen
- --
- J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
- ...ohne Gewehr
- PGP public key fingerprint = 8A 18 58 54 03 7B FC 12 1F 8B 63 C7 19 27 CF DA
-